"use strict"

/**
 * 秦皇岛市政府采购网爬虫
 *  没有找到官网
 */

var Base = require("./base");
var qhd_spider = new Base();
qhd_spider.name = "秦皇岛市政府采购网";
qhd_spider.encode = "GBK";

qhd_spider.getPageUrl = function(pg) {
    return "http://www.qhdzfcg.gov.cn/mylogon/showmore.do?Page=" + pg + "&sort=001&mk=cggg";
};

qhd_spider.getItems = function($) {
    var items = [];
    $(".list_left a").each(function(index, ele) {
        var e = $(ele);
        var item = {};
        item.title = e.text().substring(48);
        var id = e.attr("href").substring(19, 23);
        item.url = "http://www.qhdzfcg.gov.cn/mylogon/showcont.do?id=" + id;
        item.source = qhd_spider.name;
        items.push(item);
    });
    return items;
};

exports = module.exports = qhd_spider;